package com.example.pushMessage;

import com.example.entity.Payload;
import com.example.entity.Request;

/**
 * message with special lock name serialization handler in distribute nodes
 */
public interface RocketmqMessageSerializationHandler<T extends Payload, L extends RocketmqPushMessageListener> extends RocketmqMessageHandler<T, L> {

    /**
     * seconds of lease, default is 60
     */
    default Long getTTL() {
        return 60L;
    }

    /**
     * distinct business path name
     */
    String getLockName(Request<T> request);
}